package com.situ.store.controller;

import com.situ.store.service.OrderService;
import com.situ.store.service.impl.OrderServiceImpl;
import com.situ.store.util.BaseController;
import com.situ.store.vo.DataVO;
import com.situ.store.vo.LayuiTableVO;
import com.situ.store.vo.OrderTVO;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * ClassName: StatisticsController
 * Package: com.situ.store.controller
 * Description:
 *
 * @Author Darling_达
 * @Create 2023-03-04 10:03
 * @Version 1.0
 */

// 单据统计图表
@WebServlet("/statistics")
public class StatisticsController extends BaseController {

    private static final long serialVersionUID = 1L;

    OrderService ser = new OrderServiceImpl();


    public void page(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.getRequestDispatcher("/WEB-INF/echarts.jsp").forward(req, resp);
    }

    public void sum(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.getRequestDispatcher("/WEB-INF/orderDets.jsp").forward(req, resp);
    }

    public LayuiTableVO statisticsByYearInfo(String byYear){
        return ser.statisticsByYearInfo(byYear);
    }
    public LayuiTableVO statisticsByMonthInfo(String byMonth){
        return ser.statisticsByMonthInfo(byMonth);
    }
    public LayuiTableVO statisticsByDayInfo(String byDay){
        return ser.statisticsByDayInfo(byDay);
    }

    public List<DataVO> statisticsByYearIN(){
       return ser.statisticsByYearIN();
    }

    public List<DataVO> statisticsByYearOUT(){
        return ser.statisticsByYearOUT();
    }

}
